<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <th:block th:include="include :: header('新增项目合同')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
  <form class="form-horizontal m" id="form-projectContract-add">
    <input id="projectId" name="projectId" th:value="${projectId}" type="hidden">
    <div class="form-group">
      <label class="col-sm-3 control-label">服务合同：</label>
      <div class="col-sm-8">
        <input name="serviceFile" type="file" accept="application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document" required>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label">销售合同：</label>
      <div class="col-sm-8">
        <input name="saleFile" type="file" accept="application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document" required>
      </div>
    </div>
  </form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
  var prefix = ctx + "project/projectContract"
  $("#form-projectContract-add").validate({
    focusCleanup: true
  });

  function submitHandler() {
    if ($.validate.form()) {
      let data = new FormData($("#form-projectContract-add")[0]);
      $.ajax({
        url: prefix + "/add",
        type: "post",
        data: data,
        cache: false,
        processData: false,
        contentType: false,
        success: function(result) {
          $.operate.saveSuccess(result);
        }
      });
    }
  }
</script>
</body>
</html>
